#include<bits/stdc++.h>
using namespace std;
#define int long long

int a[100005];

signed main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}

	int cnt = 0;
	for (int i = 1; i < n; i++) {
		if (__gcd(a[i], a[i + 1]) != 1)
			cnt++;
	}
	cout << cnt;
	return 0;
}
